package com.sunny;

import java.util.PriorityQueue;
import java.util.Queue;

public class Main {

    public static void main(String[] args) {

        Queue<Integer> queue = new PriorityQueue<>();

        queue.add(1);
        queue.add(3);
        queue.add(2);

        print(queue);
    }

    public static void print(Queue<Integer> queue){

        while (!queue.isEmpty()){
            int a = queue.peek();//不删除
            System.out.println(a);
            int b = queue.poll();
            System.out.println(b);
        }

    }

}
